<template>
    <img src="result && result.message">
</template>

<script lang="ts">
import { defineComponent } from "vue";
import axios from 'axios';
export default defineComponent({
    //用async await 代替 promise
    async setup() {
        const rawData = await axios.get('https://dog.ceo/api/breeds/image/random');
        console.log(rawData, 'rawData');
        return {
            result: rawData.data
        }
    }

});
</script>
<style></style>